<!DOCTYPE html>
<html>
<head>
<title>Verlang page</title>
<script>
var xmlhttp;
function loadJSONDoc(url,cfunc)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=cfunc;
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("le_texte=" + document.getElementById("le_texte").value );
}

function myFunction()
{
loadJSONDoc("/send",function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("myDiv1").innerHTML=document.getElementById("myDiv1").innerHTML + "<br/>" +xmlhttp.responseText;
    }
  });
}

function loadTxtDoc(url,cfunc)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=cfunc;
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("hacker=student");
}

function myFunction1()
{
loadTxtDoc("/decrypt",function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("myDiv2").innerHTML=document.getElementById("myDiv2").innerHTML + "<br/>" +xmlhttp.responseText;
    }
  });
}

</script>
</head>
<body>

<div id="myDiv"><h2>Le texte en clair</h2>
<label>Votre texte en clair: </label>
<input id="le_texte" type="text" name="le_texte"/>
</div>
<button type="button" onclick="myFunction()">Codez!</button>
<hr/>
<div id="myDiv1"><h2>Le texte en verlang</h2>
</div>
<hr/>
<div id="myDiv2"><h2>Le texte decode:</h2>
</div>
<button type="button" onclick="myFunction1()">Decodez!</button>

</body>
</html>